/**
 * 
 */
package com.wolfware.athsweb.persistancy.springhibernate;

import java.util.List;

import com.wolfware.athsweb.domain.Athlete;
import com.wolfware.athsweb.persistancy.dao.AthleteDAO;
import com.wolfware.athsweb.persistancy.dao.ClubDAO;

/**
 * Implementation of ClubDAO.
 * 
 * @see ClubDAO
 * @author ChristianStrzadala
 */
public class SpringHibernateAthleteDAOImpl extends AbstractSpringHibernateGenericDAOImpl<Long, Athlete> implements AthleteDAO {

	public SpringHibernateAthleteDAOImpl(){
		super(Athlete.class);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Athlete> getAllAthletes() {
		return findAll();
	}

	/**
	 * {@inheritDoc}
	 */
	public Athlete getAthleteById(Long id) {
		return read(id);
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveAthleteEntries(List<Athlete> athleteList) {
        for (Athlete athlete : athleteList) {
            create(athlete);
        }
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveAthleteEntry(Athlete athlete) {
		create(athlete);
	}
}